<?php
$this->breadcrumbs=array(
    Yii::t('site','Admin')=>array('/admin'),
    Yii::t('site','Import')=>array('/admin/import'),
    $importTitle
);
?>

<h1><?php echo CHtml::encode($importTitle); ?></h1>

<div class="wide form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'import-fpr-late-items-form',
    'enableAjaxValidation'=>false,
    'htmlOptions' => array(
        'enctype'=>'multipart/form-data'
    ),
)); ?>
    
    <?php if(isset($model->importSpec['importInstructions'])) : ?>
    <div id="importInstructionsMsg" class="flash-success" style="display:none;text-align:right">
        <?php echo CHtml::link('View Import Instructions',$model->importSpec['importInstructions'],array('target'=>'_blank')); ?>
    </div>
    <?php Yii::app()->clientScript->registerScript( 'showImportInstructionsMsg','jQuery("#importInstructionsMsg").show(600);'); ?>
    <?php endif; ?>

    <p class="note"><?php echo Yii::t('site','Fields with {marker} are required.',array('{marker}'=>'<span class="required">*</span>')); ?></p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'csvFile'); ?>
        <?php echo $form->fileField($model,'csvFile',array('size'=>40,'accept'=>'text/comma-separated-values')); ?>
        <?php echo $form->error($model,'csvFile'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'csvFieldSeparator'); ?>
        <?php echo $form->dropDownList($model,'csvFieldSeparator',$model->csvFieldSeparatorOptions,array('empty'=>Yii::t('site','(Select)'))); ?>
        <?php echo $form->error($model,'csvFieldSeparator'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'truncateTable'); ?>
        <?php echo $form->checkBox($model,'truncateTable'); ?>
        <?php echo $form->error($model,'truncateTable'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'disableyKeys'); ?>
        <?php echo $form->checkBox($model,'disableyKeys'); ?>
        <?php echo $form->error($model,'disableyKeys'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'lockTable'); ?>
        <?php echo $form->checkBox($model,'lockTable'); ?>
        <?php echo $form->error($model,'lockTable'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'skipFirstNumLines'); ?>
        <?php echo $form->textField($model,'skipFirstNumLines',array('size'=>4,'class'=>'centered')); ?>
        <?php echo $form->error($model,'skipFirstNumLines'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'loadNbrOfLines'); ?>
        <?php echo $form->textField($model,'loadNbrOfLines',array('size'=>4,'class'=>'centered')); ?>
        <?php echo $form->error($model,'loadNbrOfLines'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'prepareDateAttributesOnSave'); ?>
        <?php echo $form->checkBox($model,'prepareDateAttributesOnSave'); ?>
        <?php echo $form->error($model,'prepareDateAttributesOnSave'); ?>
    </div>

    <div class="row buttons">
        <?php $this->widget( 'application.extensions.button.DDButton',
			array(
				'title'=>Yii::t('site','Upload'),
				'linkTitle'=>Yii::t('site','Upload then CSV file'),
				'formID' => 'import-fpr-late-items-form',
				'buttonType' => 'save'
		)); ?>
        <?php $this->widget( 'application.extensions.button.DDButton',
			array(
				'title'=>Yii::t('site','Reset'),
				'linkTitle'=>Yii::t('site','Reset the form data'),
				'formID' => 'import-fpr-late-items-form',
				'buttonType' => 'reset',
				'confirm' => Yii::t('site','Really reset this form?')
		)); ?>
        <?php $this->widget( 'application.extensions.button.DDButton',
			array(
				'title'=>Yii::t('site','Cancel'),
				'linkTitle'=>Yii::t('site','Cancel editing, back to list'),
				'formID' => 'import-fpr-late-items-form',
				'buttonType' => 'cancel',
				'confirm' => Yii::t('site','Really cancel uploading file?'),
				'url' => array('index')
		)); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->
